# -*- coding: utf-8 -*-
import sys
sys.path.append("../..")
from db.mysql import MysqlClient
from common.helper import Helper
class Arrangement( object ):
    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "平安少儿综合保险"
    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):
            data["name"] = self.name
            data["company"] = "平安保险"
            data["socialSec"] = item["socialSec"]
            data["accidentalDie"] = "0" if item["accidentalDie"] == "0" else str(int(int(item["accidentalDie"])/10000)) + "w"
            data["seriousDeath"] = "0" if item["seriousDeath"] == "0" else str(int(int(item["seriousDeath"])/10000)) + "w"
            data["hospitalSocial"] = "0" if item["hospitalSocial"] == "0" else str(int(int(item["hospitalSocial"])/10000)) + "w"
            data["childrenDisease"] = "0" if item["childrenDisease"] == "0" else str(int(int( item["childrenDisease"])/10000)) + "w"
            data["defineCancer"] = "0" if item["defineCancer"] == "0" else str(int(int( item["defineCancer"])/10000)) + "w"
            data["accidentHospital"] = "0" if item["accidentHospital"] == "0" else str(int(int(item["accidentHospital"])/10000)) + "w"
            data["accidentOutpatient"] = "5000"
            data["accidentAllowance"] = "0" if item["accidentAllowance"] == "0" else "100/天"
            data["plan"] = item["plan"]
            data["price"] = item["price"]
            Helper.mergeTable( self.name,self.mysql,data )

